package user

import (
	"context"
	"large-model-platform-backend/internal/svc"
	"large-model-platform-backend/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type RemoveLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewRemoveLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RemoveLogic {
	return &RemoveLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *RemoveLogic) Remove(req *types.UserDeleteReq) (resp *types.BooleanResp, err error) {
	userModel := l.svcCtx.UserModel
	_, err = userModel.Delete(l.ctx, req.UserId)
	return &types.BooleanResp{
		Result: types.Result{Code: 200},
		Data:   true,
	}, nil
}
